# -*- coding: utf-8 -*-

from pyltp import Segmentor

class PyltpSegmenter:
    def __init__(self, model_path):
        self.segmentor = Segmentor()
        self.segmentor.load(model_path)

    def segment(self, text):
        return self.segmentor.segment(text)

    def release(self):
        self.segmentor.release()
